home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.amiga.programmer
- Path: surfnet.nl!sun4nl!hguijt
- From: hguijt@solair1.inter.NL.net (Hans Guijt)
- Subject: Re: MIDI + C + AMIGA !!
- Message-ID: <DnDooB.Ctt@solair1.inter.NL.net>
- Organization: NLnet
- X-Newsreader: TIN [version 1.2 PL2]
- Date: Mon, 26 Feb 1996 10:19:23 GMT
-
- >> Ok, so maybe quality would suffer, but you could always buy a Toccata and
- >> use the Delitracker Toccata driver. In the mean time the rest of us could
- >> at least play those songs.
- >
- >Albeit without being able to do anything else at the same time onthe
- >majority of achines.
-
- Ah-ha! So now we are down to 'majority' rather than 'impossible'. That's
- good, I like making progress ;-)
-
- I have an MSX machine next to my Amiga. I have a soundplayer on it that I
- like to run occasionally, even though it is singletasking. It's just that I
- like the sound it makes.
-
- >> So? Alien Breed 3D uses 8 notes polyphony and manages to run a complete
- >> Doom-style engine at the same time! 24 note polyphony isn't basically
- >harder
- >> or slower (a little over three times slower I would say - that would leave
- >> enough power for me to do what I usually do with my machine).
- >
- >Have you actually thought about this? "I can do 8-note, so 24-note is no
- >problem ". From this, we can say "24-note is no problem,. so we can do
- >72-note easily".
-
- A little bit, yes. Let's examine the problem from another direction -
- suppose I want to build a program like this, I would start with something
- like:
-
- - Resample channel #1 for the next period
- - " " #2 " " " "
- ...
- - Mix channels #1..#n into one hardware channel
- ...
-
- Now, when playing 8-note music we have to resample 8 channels, while playing
- 24 notes obviously requires 24 resampling passes (in other words, exactly
- three times as slow). The mixing routine will be more complex, but then
- again this is an extremely simple routine anyway:
-
- move.l #Buf1,a0
- move.l #Buf2,a1
- move.l #Buf3,a2
- ...
- move.l #Dest,a6
- move.w #BufSize,d0
- moveq #0,d1
- moveq #0,d2
-
- .x move.b (a0)+,d1
- move.b (a1)+,d2
- add.w d2,d1
- move.b (a2)+,d2
- add.w d2,d1
- ...
- lsr.w #(2 or 3),d1
- move.b d1,(a6)+
- dbra d0,.x
-
- This (rather awful) piece of code (or something similar to it) will do the
- job, and will not take that many more cycles when more channels must be
- mixed in.
-
- >Running GMPlay on my machine at home (`020, 10Mb RAM) DOES virtually lock up
- >the entire system. The system is NOT useable whilst the program is running.
- >Fact. Sorry if you do not like this, but there we are.
-
- That's because the author uses Forbid during the sampling stage. The problem
- is with the programming, not with the actual technique. He deliberately
- chooses to take down the machine - and you are right, I do not like this.
-
- >> Care to explain why any of these are hard to do? As far as I can tell
- >these
- >> are just standard music commands for adjusting volume and frequency, which
- >> are fairly standard (one might even say 'essential') on any other music
- >> playing system. Really, there is no magic in midi.
- >
- >They all take extra time to process. Processing power and time which is
- >just
- >not there on an 020-based machine...
-
- Oh, now I understand: a format like S3M *DOESN'T* contain information to
- adjust volume and frequency! That probably explains why I can play such
- well-sounding S3M songs on my lowly '030.
-
- It's the resampling that takes most time in routines such as these, the
- other bits are minor details in comparison. In the end any songformat comes
- down to a long list of 'Play sample #n at frequency #f and volume #v'-type
- commands. Perhaps MIDI utilises a harder system than others (although I
- doubt it) but it would explain the conversion being carried out before the
- song starts playing.
-
- >> Explain this then: I have an 8 channel song running in the background
- >right
- >> now. It sounds excellent and it causes no noticable slowdown on my machine
- >> (a4030).
- >
- >A4000 / 030, presumably. == much more processor power than on an A1200.
- >Think about it.
-
- It's about 4 times faster than an a1200 without fastram. That means a
- routine like this could use 25% CPU time and it would still run fine on such
- a machine. Only thing is, it uses far less than 25%...
-
- >("Hey, I can run Breathless at 1x1 full sscreen on my A4000/040 so you
- >should have
- >no problems on an A1200"...)
-
- Breathless does (let's take a guess) ...25fps on an a4040? And assuming it's
- about 20 times as fast as an a1200 that would put the a1200 machine on about
- 2..3 fps.
-
- >GMPlay is a good program, of that there is no doubt. However, it is NOT
- >suited
- >to playing GM midi files whilst multitasking on all but the most powerful
- >of machines
- >(certainly true on my `020 at home, and my A4000/040 here in the office).
-
- I never said GMPlay is fit for doing that - I said it is a good start, but a
- better MIDI player (one that multitasks) is feasible.
-
-
- Bye,
-
- Hans
-
-